package com.spring.springdemo.springtest;

import org.springframework.beans.factory.FactoryBean;

public class StudentFactory implements FactoryBean {

    String target;

    @Override
    public Object getObject() throws Exception {
        Object o = Class.forName(target).newInstance();
        return  o;
    }

    @Override
    public Class<?> getObjectType() {
        return Student.class;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }
}
